class CL_2 extends egret.DisplayObjectContainer {
    private imageName: string
    private speed: number = 3
    public itemWidth: number = 0
    public constructor(imageName) {
        super()
        this.imageName = imageName
        this.once(egret.Event.ADDED_TO_STAGE, this.init, this)
    }
    private init() {
        this.createCL()
    }
    private createCL() {
        const container = new egret.Sprite()
        this.addChild(container)

        const mivaMask = Utils.createBitmapByName(this.imageName)
        container.addChild(mivaMask)

        if(!mivaMask.texture) {
            this.alpha = 0
        }

        const mivaItem = Utils.createBitmapByName(this.imageName)
        container.addChild(mivaItem)
        this.itemWidth = mivaItem.width
        mivaItem.mask = mivaMask

        const juanzhou = Utils.createBitmapByName('juanzhou_2_png')
        Utils.anchorCenter(juanzhou)
        juanzhou.y = mivaItem.height / 2
        container.addChild(juanzhou)

        const juanzhou_2 = Utils.createBitmapByName('juanzhou_2_png')
        Utils.anchorCenter(juanzhou_2)
        juanzhou_2.x = mivaItem.width
        juanzhou_2.y = mivaItem.height / 2
        container.addChild(juanzhou_2)


        mivaMask.width = 0
        mivaMask.x = mivaItem.width
        juanzhou.x = mivaItem.width
        egret.Tween.get(mivaMask)
            .to({ width: mivaItem.width, x: 0 }, 1000 * this.speed)
        egret.Tween.get(juanzhou)
            .to({ x: 0 + 18 }, 1000 * this.speed)
    }
}